package com.elsa.smart_buffet.controller;

import com.alibaba.fastjson.JSON;
import com.elsa.smart_buffet.pojo.ResultBox.ResponseResult;
import com.elsa.smart_buffet.service.CategoryPriceService;
import com.elsa.smart_buffet.service.DayMpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : DayMpController  //类名
 * @Author : elsa //作者
 */
@RestController
@CrossOrigin
public class DayMpController {

    @Autowired
    private DayMpService dayMpService;

    @PostMapping("/getDayMpNumByDate")
    public int getDayMpNumByDate(@RequestBody String data) {
        return dayMpService.getDayMpNumByDate(JSON.parseObject(data).get("data").toString());
    }

    @PostMapping("/getDayMpNumByMonth")
    public int getDayMpNumByMonth(@RequestBody String data) {
        return dayMpService.getDayMpNumByMonth(JSON.parseObject(data).get("data").toString());
    }

}
